package com.laowang.project.system.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.laowang.project.system.mapper.MyTemplateMessageMapper;
import com.laowang.project.system.domain.MyTemplateMessage;
import com.laowang.project.system.service.MyTemplateMessageService;

/**
 * 用户消息Service业务层处理
 *
 * @author laowang
 * @date 2023-05-24
 */
@Service
public class MyTemplateMessageServiceImpl implements MyTemplateMessageService {
    @Autowired
    private MyTemplateMessageMapper myTemplateMessageMapper;

    /**
     * 查询用户消息
     *
     * @param id 用户消息ID
     * @return 用户消息
     */
    @Override
    public MyTemplateMessage selectMyTemplateMessageById(Integer id) {
        return myTemplateMessageMapper.selectMyTemplateMessageById(id);
    }

    /**
     * 查询用户消息列表
     *
     * @param myTemplateMessage 用户消息
     * @return 用户消息
     */
    @Override
    public List<MyTemplateMessage> selectMyTemplateMessageList(MyTemplateMessage myTemplateMessage) {
        return myTemplateMessageMapper.selectMyTemplateMessageList(myTemplateMessage);
    }

    /**
     * 新增用户消息
     *
     * @param myTemplateMessage 用户消息
     * @return 结果
     */
    @Override
    public int insertMyTemplateMessage(MyTemplateMessage myTemplateMessage) {
        myTemplateMessage.setCtime(new Date());
        return myTemplateMessageMapper.insertMyTemplateMessage(myTemplateMessage);
    }

    /**
     * 修改用户消息
     *
     * @param myTemplateMessage 用户消息
     * @return 结果
     */
    @Override
    public int updateMyTemplateMessage(MyTemplateMessage myTemplateMessage) {
        return myTemplateMessageMapper.updateMyTemplateMessage(myTemplateMessage);
    }

    /**
     * 批量删除用户消息
     *
     * @param ids 需要删除的用户消息ID
     * @return 结果
     */
    @Override
    public int deleteMyTemplateMessageByIds(Integer[] ids) {
        return myTemplateMessageMapper.deleteMyTemplateMessageByIds(ids);
    }

    /**
     * 删除用户消息信息
     *
     * @param id 用户消息ID
     * @return 结果
     */
    @Override
    public int deleteMyTemplateMessageById(Integer id) {
        return myTemplateMessageMapper.deleteMyTemplateMessageById(id);
    }

    @Override
    public List<MyTemplateMessage> selectMyTemplateMessageListWeb(MyTemplateMessage myTemplateMessage) {
        return myTemplateMessageMapper.selectMyTemplateMessageListWeb(myTemplateMessage);
    }
}
